home *** CD-ROM | disk | FTP | other *** search
/ AGA Toolkit '97 / The AGA Toolkit '97.iso / text / misc / port / oldstuff / portsource.lha / Port110.S < prev    next >
Encoding:
Text File  |  1993-02-05  |  12.0 KB  |  936 lines

  1. ; in 7, 10
  2.  
  3.     include    "src:shadowlord.i"
  4.  
  5. ; V1.01
  6. ; Added bigger understanding of PC box characters.
  7. ; Now also understands one-wide box chars, and thick corner changed to #,
  8. ; single corner to +.
  9.  
  10. ; V1.02
  11. ; Added bad mode error, and error on no space between mode and the rest.
  12.  
  13. ; V1.10
  14. ; Added cut endspace.
  15. ; Added text output.
  16.  
  17. * 05-Feb-93
  18. * 10 days of hard coding
  19.  
  20. ; during the program
  21. ; a0=source
  22. ; a1=dest
  23. ; a2=spacebuf
  24.  
  25. ; d0=current char
  26. ; d1=load counter
  27. ; d2=savebyte counter
  28.  
  29. testmode    =    1
  30.  
  31.     if    testmode=1
  32.     lea    test_comline,a0
  33.     move.l    #test_len,d0
  34.     endc
  35.  
  36. progstart:
  37.     clr.b    -1(a0,d0.l)
  38.     move.l    a0,commandstart
  39.     move.w    d0,commandlen
  40.     add.l    d0,a0
  41.     subq.l    #1,a0
  42.     move.l    a0,commandend
  43.  
  44.     lea    dosname,a1
  45.     moveq    #0,d0
  46.     move.l    execbase,a6
  47.     jsr    openlibrary(a6)
  48.     move.l    d0,dosbase
  49.  
  50.     move.l    dosbase,a6
  51.     jsr    output(a6)
  52.     move.l    d0,outstruct
  53.  
  54.     move.l    #text_cursoroff,d2
  55.     moveq    #5,d3
  56.     bsr    printtext
  57.  
  58.     move.l    commandstart,a0
  59.     tst.b    (a0)            ; if blank commandline, instructions
  60.     beq    credits
  61.     cmp.b    #"?",(a0)
  62.     beq    credits
  63.     cmp.b    #"-",(a0)
  64.     beq    checkoption
  65.  
  66. parse:
  67.     cmp.b    #" ",1(a0)        ; at least one space after option
  68.     bne    err_nocomlinespace
  69.     cmp.b    #"p",(a0)
  70.     beq    frompcmode
  71.     cmp.b    #"P",(a0)
  72.     beq    topcmode
  73.     cmp.b    #"s",(a0)
  74.     beq    fromsf7mode
  75.     cmp.b    #"S",(a0)
  76.     beq    tosf7mode
  77.     bra    err_badmode
  78.  
  79. checkoption:
  80.     cmp.b    #"n",1(a0)
  81.     beq    opt_nocutspace
  82.     bra    err_badcomline
  83.  
  84. opt_nocutspace:
  85.     clr.b    mode_cutspace
  86.     addq.l    #2,a0
  87.     cmp.b    #" ",(a0)
  88.     bne    err_badcomline
  89.     bsr    skipspace
  90.     bra    parse
  91.  
  92. frompcmode:
  93.     move.b    #1,mode
  94.     bra    nameparse
  95.  
  96. fromsf7mode:
  97.     move.b    #2,mode
  98.     bra    nameparse
  99.  
  100. tosf7mode:
  101.     move.b    #-2,mode
  102.     bra    nameparse
  103.  
  104. topcmode:
  105.     move.b    #-1,mode
  106.     bra    nameparse
  107.  
  108. nameparse:
  109.     addq.l    #1,a0
  110.     bsr    skipspace
  111.     cmp.l    #0,a0
  112.     beq    err_badcomline
  113.     move.l    a0,sourcenamestart
  114.     bsr    findend
  115.     cmp.l    #0,a0
  116.     beq    err_badcomline
  117.     move.l    a0,sourcenameend
  118.     addq.l    #1,a0
  119.     sub.l    sourcenamestart,a0
  120.     move.l    a0,sourcenamelen
  121.  
  122.     move.l    sourcenamestart,a0
  123.     move.l    #sourcename,a1
  124.     move.l    sourcenamelen,d0
  125.     subq.l    #1,d0
  126.     cmp.b    #'"',(a0)
  127.     beq    removequotes
  128.  
  129. copysourcename:
  130.     move.b    (a0)+,(a1)+
  131.     dbf    d0,copysourcename
  132.     clr.b    (a1)
  133.  
  134.     move.l    sourcenameend,a0
  135.     addq.l    #1,a0
  136.     cmp.l    commandend,a0
  137.     beq    nodest
  138.  
  139.     bsr    skipspace
  140.     cmp.l    #0,a0
  141.     beq    err_badcomline
  142.     move.l    a0,destnamestart
  143.     bsr    findend
  144.     cmp.l    #0,a0
  145.     beq    err_badcomline
  146.     move.l    a0,destnameend
  147.     addq.l    #1,a0
  148.     sub.l    destnamestart,a0
  149.     move.l    a0,destnamelen
  150.     move.l    a0,d0
  151.  
  152.     move.l    destnamestart,a0
  153.     move.l    #destname,a1
  154.     subq.l    #1,d0
  155.     cmp.b    #'"',(a0)
  156.     beq    removequotes1
  157.  
  158. copydestname:
  159.     move.b    (a0)+,(a1)+
  160.     dbf    d0,copydestname
  161.     bra    openfiles
  162.  
  163. removequotes:
  164.     addq.l    #1,a0
  165.     subq.l    #2,d0
  166.     bra    copysourcename
  167.  
  168. removequotes1:
  169.     addq.l    #1,a0
  170.     subq.l    #2,d0
  171.     bra    copydestname
  172.  
  173. removequotes2:
  174.     addq.l    #1,a0
  175.     subq.l    #2,d0
  176.     bra    copydestname1
  177.  
  178. nodest:
  179.     move.l    #destname,a1
  180.     move.l    sourcenamestart,a0
  181.     move.l    sourcenamelen,d0
  182.     subq.l    #1,d0
  183.     cmp.b    #'"',(a0)
  184.     beq    removequotes2
  185.  
  186. copydestname1:
  187.     move.b    (a0)+,(a1)+
  188.     dbf    d0,copydestname1
  189.  
  190.     cmp.b    #-1,mode
  191.     beq    pcsuffix
  192.     cmp.b    #-2,mode
  193.     beq    sf7suffix
  194.  
  195. amigasuffix:
  196.     lea    text_amigasuf,a0
  197.     moveq    #4-1,d0
  198.  
  199. amigasuffix1:
  200.     move.b    (a0)+,(a1)+
  201.     dbf    d0,amigasuffix1
  202.     bra    openfiles
  203.  
  204. pcsuffix:
  205.     lea    text_pcsuf,a0
  206.     moveq    #3-1,d0
  207.  
  208. pcsuffix1:
  209.     move.b    (a0)+,(a1)+
  210.     dbf    d0,pcsuffix1
  211.     bra    openfiles
  212.  
  213. sf7suffix:
  214.     lea    text_sf7suf,a0
  215.     moveq    #4-1,d0
  216.  
  217. sf7suffix1:
  218.     move.b    (a0)+,(a1)+
  219.     dbf    d0,sf7suffix1
  220.  
  221. openfiles:
  222.     clr.b    (a1)            ; end of filename
  223.     move.l    #sourcename,d1
  224.     move.l    #1005,d2
  225.     move.l    dosbase,a6
  226.     jsr    open(a6)
  227.     tst.l    d0
  228.     beq    err_nosource
  229.     move.l    d0,sourcehandle
  230.  
  231.     move.l    #destname,d1
  232.     move.l    #1006,d2
  233.     move.l    dosbase,a6
  234.     jsr    open(a6)
  235.     tst.l    d0
  236.     beq    err_nodest
  237.     move.l    d0,desthandle
  238.  
  239. readblock:
  240.     move.l    sourcehandle,d1
  241.     move.l    #sourcebuf,d2
  242.     move.l    #1024,d3
  243.     move.l    dosbase,a6
  244.     jsr    read(a6)
  245.     add.l    d0,readbytes
  246.     move.l    d0,d1
  247.     beq    closefiles        ; readbytes=0 - quit
  248.     subq.l    #1,d1
  249.     moveq    #0,d2
  250.  
  251.     lea    sourcebuf,a0
  252.     lea    destbuf,a1
  253.  
  254. morecharacters:
  255.     move.b    (a0)+,d0
  256.     bra    cutspace
  257.  
  258. checknormal:
  259.     cmp.b    #-2,mode
  260.     beq    tosf7
  261.     cmp.b    #-1,mode
  262.     beq    topc
  263.     cmp.b    #2,mode
  264.     beq    fromsf7
  265.  
  266. frompc:
  267.     cmp.b    #$84,d0
  268.     beq    ami_lowae
  269.     cmp.b    #$94,d0
  270.     beq    ami_lowoe
  271.     cmp.b    #$8e,d0
  272.     beq    ami_upae
  273.     cmp.b    #$99,d0
  274.     beq    ami_upoe
  275.     cmp.b    #13,d0
  276.     beq    nochar
  277.     cmp.b    #0,d0
  278.     beq    nochar
  279.     cmp.b    #$1a,d0            ; ctrl+z
  280.     beq    nochar
  281.     cmp.b    #$c9,d0
  282.     beq    ami_bigcorner
  283.     cmp.b    #$bb,d0
  284.     beq    ami_bigcorner
  285.     cmp.b    #$c8,d0
  286.     beq    ami_bigcorner
  287.     cmp.b    #$bc,d0
  288.     beq    ami_bigcorner
  289.     cmp.b    #$cd,d0
  290.     beq    ami_doubleline
  291.     cmp.b    #$ba,d0
  292.     beq    ami_upline
  293.     cmp.b    #$b3,d0
  294.     beq    ami_upline
  295.     cmp.b    #$b0,d0
  296.     beq    ami_box
  297.     cmp.b    #$b1,d0
  298.     beq    ami_box
  299.     cmp.b    #$b2,d0
  300.     beq    ami_box
  301.     cmp.b    #$c4,d0
  302.     beq    ami_singleline
  303.     cmp.b    #$c0,d0
  304.     beq    ami_smallcorner
  305.     cmp.b    #$d9,d0
  306.     beq    ami_smallcorner
  307.     cmp.b    #$bf,d0
  308.     beq    ami_smallcorner
  309.     cmp.b    #$da,d0
  310.     beq    ami_smallcorner
  311.  
  312. nextchar:
  313.     move.b    d0,(a1)+
  314.     addq.l    #1,d2
  315.  
  316. nochar:
  317.     dbf    d1,morecharacters
  318.  
  319.     move.l    desthandle,d1
  320.     move.l    d2,d3
  321.     add.l    d2,writtenbytes
  322.     move.l    #destbuf,d2
  323.     move.l    dosbase,a6
  324.     jsr    write(a6)
  325.  
  326.     move.l    #text_input,d2
  327.     moveq    #15,d3
  328.     bsr    printtext
  329.  
  330.     lea    numberbuf,a0
  331.     move.l    readbytes,d0
  332.     bsr    num2ascii
  333.  
  334.     move.l    a0,d2
  335.     move.l    d0,d3
  336.     bsr    printtext
  337.  
  338.     move.l    #text_output,d2
  339.     moveq    #18,d3
  340.     bsr    printtext
  341.  
  342.     lea    numberbuf,a0
  343.     move.l    writtenbytes,d0
  344.     bsr    num2ascii
  345.  
  346.     move.l    a0,d2
  347.     move.l    d0,d3
  348.     bsr    printtext
  349.  
  350.     move.l    #text_cr,d2
  351.     moveq    #1,d3
  352.     bsr    printtext
  353.  
  354.     bra    readblock
  355.  
  356. cutspace:
  357.     move.l    spacepointer,a2
  358.     cmp.b    #" ",d0
  359.     beq    addspace
  360.     cmp.b    #9,d0            ; tab
  361.     beq    addspace
  362.  
  363.     cmp.b    #1,mode_cutspace
  364.     bne    cutspace1
  365.  
  366.     cmp.b    #10,d0            ; lf
  367.     beq    cutspaces
  368.     cmp.b    #13,d0            ; cr
  369.     beq    cutspaces
  370.  
  371. cutspace1:
  372.     tst.l    spacenumber
  373.     bne    linkspaces
  374.     bra    checknormal
  375.  
  376. addspace:
  377.     addq.l    #1,spacenumber
  378.     move.b    d0,(a2)+
  379.     move.l    a2,spacepointer
  380.     bra    nochar
  381.  
  382. cutspaces:
  383.     clr.l    spacenumber
  384.     move.l    #spacebuf,spacepointer
  385.     bra    checknormal
  386.  
  387. linkspaces:
  388.     move.l    spacenumber,d3
  389.     add.l    d3,d2
  390.     subq.l    #1,d3
  391.     lea    spacebuf,a2
  392.  
  393. linkspaces1:
  394.     move.b    (a2)+,(a1)+
  395.     dbf    d3,linkspaces1
  396.     clr.l    spacenumber
  397.     move.l    #spacebuf,spacepointer
  398.     bra    checknormal
  399.  
  400. topc:
  401.     cmp.b    #"ä",d0
  402.     beq    pc_lowae
  403.     cmp.b    #"ö",d0
  404.     beq    pc_lowoe
  405.     cmp.b    #"Ä",d0
  406.     beq    pc_upae
  407.     cmp.b    #"Ö",d0
  408.     beq    pc_upoe
  409.     cmp.b    #10,d0
  410.     beq    addcr
  411.     cmp.b    #0,d0
  412.     beq    nochar
  413.     cmp.b    #$1a,d0            ; ctrl+z
  414.     beq    nochar
  415.     bra    nextchar
  416.  
  417. fromsf7:
  418.     cmp.b    #"{",d0
  419.     beq    ami_lowae
  420.     cmp.b    #"|",d0
  421.     beq    ami_lowoe
  422.     cmp.b    #"[",d0
  423.     beq    ami_upae
  424.     cmp.b    #"\",d0
  425.     beq    ami_upoe
  426.     cmp.b    #13,d0
  427.     beq    nochar
  428.     cmp.b    #0,d0
  429.     beq    nochar
  430.     cmp.b    #$1a,d0            ; ctrl+z
  431.     beq    nochar
  432.     bra    nextchar
  433.  
  434. tosf7:
  435.     cmp.b    #"ä",d0
  436.     beq    sf7_lowae
  437.     cmp.b    #"ö",d0
  438.     beq    sf7_lowoe
  439.     cmp.b    #"Ä",d0
  440.     beq    sf7_upae
  441.     cmp.b    #"Ö",d0
  442.     beq    sf7_upoe
  443.     cmp.b    #10,d0
  444.     beq    addcr
  445.     cmp.b    #0,d0
  446.     beq    nochar
  447.     cmp.b    #$1a,d0            ; ctrl+z
  448.     beq    nochar
  449.     bra    nextchar
  450.  
  451. ami_singleline:
  452.     move.b    #"-",d0
  453.     bra    nextchar
  454.  
  455. ami_box:
  456.     move.b    #$7f,d0
  457.     bra    nextchar
  458.  
  459. ami_upline:
  460.     move.b    #"|",d0
  461.     bra    nextchar
  462.  
  463. ami_doubleline:
  464.     move.b    #"=",d0
  465.     bra    nextchar
  466.  
  467. ami_smallcorner:
  468.     move.b    #"+",d0
  469.     bra    nextchar
  470.  
  471. ami_bigcorner:
  472.     move.b    #"#",d0
  473.     bra    nextchar
  474.  
  475. ami_lowae:
  476.     move.b    #"ä",d0
  477.     bra    nextchar
  478.  
  479. ami_lowoe:
  480.     move.b    #"ö",d0
  481.     bra    nextchar
  482.  
  483. ami_upae:
  484.     move.b    #"Ä",d0
  485.     bra    nextchar
  486.  
  487. ami_upoe:
  488.     move.b    #"Ö",d0
  489.     bra    nextchar
  490.  
  491. pc_lowae:
  492.     move.b    #$84,d0
  493.     bra    nextchar
  494.  
  495. pc_lowoe:
  496.     move.b    #$94,d0
  497.     bra    nextchar
  498.  
  499. pc_upae:
  500.     move.b    #$8e,d0
  501.     bra    nextchar
  502.  
  503. pc_upoe:
  504.     move.b    #$99,d0
  505.     bra    nextchar
  506.  
  507. sf7_lowae:
  508.     move.b    #"{",d0
  509.     bra    nextchar
  510.  
  511. sf7_lowoe:
  512.     move.b    #"|",d0
  513.     bra    nextchar
  514.  
  515. sf7_upae:
  516.     move.b    #"[",d0
  517.     bra    nextchar
  518.  
  519. sf7_upoe:
  520.     move.b    #"\",d0
  521.     bra    nextchar
  522.  
  523. addcr:
  524.     move.b    #13,(a1)+
  525.     addq.l    #1,d2
  526.     bra    nextchar
  527.  
  528. closefiles:
  529.     move.l    sourcehandle,d1
  530.     move.l    dosbase,a6
  531.     jsr    close(a6)
  532.     move.l    desthandle,d1
  533.     move.l    dosbase,a6
  534.     jsr    close(a6)
  535.     bra    endprogram1
  536.  
  537. credits:
  538.     move.l    #text_credits,d2
  539.     move.l    #len_credits,d3
  540.     bsr    printtext
  541.     bra    endprogram1
  542.  
  543. err_nosource:
  544.     move.l    #text_nosource,d2
  545.     moveq    #36,d3
  546.     bsr    printtext
  547.     bra    endprogram1
  548.  
  549. err_nomemory:
  550.     move.l    #text_nomemory,d2
  551.     moveq    #26,d3
  552.     bsr    printtext
  553.     bra    endprogram1
  554.  
  555. err_badcomline:
  556.     move.l    #text_badcomline,d2
  557.     moveq    #25,d3
  558.     bsr    printtext
  559.     bra    endprogram1
  560.  
  561. err_nodest:
  562.     move.l    #text_nodest,d2
  563.     moveq    #41,d3
  564.     bsr    printtext
  565.     bra    endprogram2
  566.  
  567. err_badmode:
  568.     move.l    #text_badmode,d2
  569.     moveq    #32,d3
  570.     bsr    printtext
  571.     bra    endprogram1
  572.  
  573. err_nocomlinespace:
  574.     move.l    #text_nocomlinespace,d2
  575.     moveq    #60,d3
  576.     bsr    printtext
  577.     bra    endprogram1
  578.  
  579. endprogram1:
  580.     move.l    #text_cursoron,d2
  581.     moveq    #6,d3
  582.     bsr    printtext
  583.  
  584.     move.l    execbase,a6
  585.     move.l    dosbase,a1
  586.     jsr    closelibrary(a6)
  587.     moveq    #0,d0
  588.     rts
  589.  
  590. endprogram2:
  591.     move.l    sourcehandle,d1
  592.     move.l    dosbase,a6
  593.     jsr    close(a6)
  594.     bra    endprogram1
  595.  
  596. **********
  597. ** SUBS **
  598. **********
  599.  
  600. printtext:
  601.     if    testmode=1
  602.     rts
  603.     endc
  604.     move.l    outstruct,d1
  605.     move.l    dosbase,a6
  606.     jsr    write(a6)
  607.     rts
  608.  
  609. skipspace:
  610.     cmp.b    #" ",(a0)
  611.     beq    skipspace1
  612.     rts
  613.  
  614. skipspace1:
  615.     add.l    #1,a0
  616.     cmp.l    commandend,a0
  617.     bcs    skipspace
  618.     move.l    #0,a0
  619.     rts
  620.  
  621. findend:
  622.     cmp.b    #'"',(a0)
  623.     beq    findend_quote
  624.  
  625. findend_space:
  626.     addq.l    #1,a0
  627.     cmp.b    #" ",(a0)
  628.     beq    findend_space1
  629.     cmp.b    #0,(a0)
  630.     beq    findend_space1
  631.     cmp.l    commandend,a0
  632.     bls    findend_space
  633.     move.l    #0,a0
  634.     rts
  635.  
  636. findend_space1:
  637.     subq.l    #1,a0
  638.     rts
  639.  
  640. findend_quote:
  641.     addq.l    #1,a0
  642.     cmp.b    #'"',(a0)
  643.     bne    findend_quote1
  644.     rts
  645.  
  646. findend_quote1:
  647.     cmp.l    commandend,a0
  648.     bls    findend_quote
  649.     move.l    #0,a0
  650.     rts
  651.  
  652. num2ascii:
  653.     clr.l    d1
  654.     move.l    a0,a1    
  655.  
  656. num2ascii1:
  657.     cmp.l    #1000000000,d0
  658.     bcc    onegig
  659.     move.b    d1,(a0)
  660.     add.b    #"0",(a0)+
  661.     clr.l    d1
  662.  
  663. num2ascii2:
  664.     cmp.l    #100000000,d0
  665.     bcc    one100meg
  666.     move.b    d1,(a0)
  667.     add.b    #"0",(a0)+
  668.     clr.l    d1
  669.  
  670. num2ascii3:
  671.     cmp.l    #10000000,d0
  672.     bcc    one10meg
  673.     move.b    d1,(a0)
  674.     add.b    #"0",(a0)+
  675.     clr.l    d1
  676.  
  677. num2ascii4:
  678.     cmp.l    #1000000,d0
  679.     bcc    onemeg
  680.     move.b    d1,(a0)
  681.     add.b    #"0",(a0)+
  682.     clr.l    d1
  683.  
  684. num2ascii5:
  685.     cmp.l    #100000,d0
  686.     bcc    one100k
  687.     move.b    d1,(a0)
  688.     add.b    #"0",(a0)+
  689.     clr.l    d1
  690.  
  691. num2ascii6:
  692.     cmp.l    #10000,d0
  693.     bcc    one10k
  694.     move.b    d1,(a0)
  695.     add.b    #"0",(a0)+
  696.     clr.l    d1
  697.  
  698. num2ascii7:
  699.     cmp.l    #1000,d0
  700.     bcc    onek
  701.     move.b    d1,(a0)
  702.     add.b    #"0",(a0)+
  703.     clr.l    d1
  704.  
  705. num2ascii8:
  706.     cmp.l    #100,d0
  707.     bcc    one100
  708.     move.b    d1,(a0)
  709.     add.b    #"0",(a0)+
  710.     clr.l    d1
  711.  
  712. num2ascii9:
  713.     cmp.l    #10,d0
  714.     bcc    one10
  715.     move.b    d1,(a0)
  716.     add.b    #"0",(a0)+
  717.     clr.l    d1
  718.  
  719. num2ascii10:
  720.     move.b    d0,(a0)
  721.     add.b    #"0",(a0)
  722.     move.l    a1,a0
  723.  
  724. num2ascii11:
  725.     cmp.b    #"0",(a0)
  726.     beq    num2ascii_clearzero
  727.  
  728.     move.l    a1,a0
  729.     moveq    #10,d0
  730.  
  731. num2ascii12:
  732.     cmp.b    #" ",(a0)
  733.     beq    num2ascii_sublen
  734.     rts
  735.  
  736. num2ascii_sublen:
  737.     subq.l    #1,d0
  738.     add.l    #1,a0
  739.     bra    num2ascii12
  740.  
  741. num2ascii_clearzero:
  742.     move.b    #" ",(a0)+
  743.     bra    num2ascii11
  744.  
  745. onegig:
  746.     sub.l    #1000000000,d0
  747.     addq.l    #1,d1
  748.     bra    num2ascii1
  749.  
  750. one100meg:
  751.     sub.l    #100000000,d0
  752.     addq.l    #1,d1
  753.     bra    num2ascii2
  754.  
  755. one10meg:
  756.     sub.l    #10000000,d0
  757.     addq.l    #1,d1
  758.     bra    num2ascii3
  759.  
  760. onemeg:
  761.     sub.l    #1000000,d0
  762.     addq.l    #1,d1
  763.     bra    num2ascii4
  764.  
  765. one100k:
  766.     sub.l    #100000,d0
  767.     addq.l    #1,d1
  768.     bra    num2ascii5
  769.  
  770. one10k:
  771.     sub.l    #10000,d0
  772.     addq.l    #1,d1
  773.     bra    num2ascii6
  774.  
  775. onek:
  776.     sub.l    #1000,d0
  777.     addq.l    #1,d1
  778.     bra    num2ascii7
  779.  
  780. one100:
  781.     sub.l    #100,d0
  782.     addq.l    #1,d1
  783.     bra    num2ascii8
  784.  
  785. one10:
  786.     sub.l    #10,d0
  787.     addq.l    #1,d1
  788.     bra    num2ascii9
  789.  
  790.  
  791. **********
  792. ** DATA **
  793. **********
  794.  
  795.     section    fastdata,data
  796.  
  797. spacepointer:
  798.     dc.l    spacebuf
  799.  
  800. text_credits:
  801.     incbin    "src:Port/PortOpts"
  802.  
  803. text_cursoroff:
  804.     dc.b    27,"[0 p"
  805.  
  806. text_cursoron:
  807.     dc.b    27,"[1 p",10
  808.  
  809. text_badcomline:
  810.     dc.b    "ERROR!  Bad commandline.",10
  811.  
  812. text_nomemory:
  813.     dc.b    "ERROR!  Not enough memory.",10
  814.  
  815. text_badsource:
  816.     dc.b    "ERROR!  Bad sourcefile.",10
  817.  
  818. text_nosource:
  819.     dc.b    "ERROR!  Could not open source file.",10
  820.  
  821. text_nodest:
  822.     dc.b    "ERROR!  Could not open destination file.",10
  823.  
  824. text_badmode:
  825.     dc.b    "ERROR!  Bad mode specification.",10
  826.  
  827. text_nocomlinespace:
  828.     dc.b    "ERROR!  The mode must be separated with at least one space.",10
  829.  
  830. text_input:
  831.     dc.b    27,"[1mInput: ",27,"[0m"
  832.  
  833. text_output:
  834.     dc.b    27,"[1m  Output: ",27,"[0m"
  835.  
  836. dosname:
  837.     dc.b    "dos.library",0
  838.  
  839. text_amigasuf:
  840.     dc.b    ".AMI"
  841.  
  842. text_pcsuf:
  843.     dc.b    ".PC"
  844.  
  845. text_sf7suf:
  846.     dc.b    ".SF7"
  847.  
  848. text_cr:
  849.     dc.b    13
  850.  
  851. mode_cutspace:
  852.     dc.b    1
  853.  
  854.     if    testmode=1
  855.  
  856. test_comline:
  857.     dc.b    "p dh1:text/k-18/megatext2 dh1:text/k-18/megatext3",10
  858.  
  859. test_comlineend:
  860.  
  861. test_len    =    test_comlineend-test_comline
  862.     endc
  863.  
  864.     section    fastblank,bss
  865.  
  866. writtenbytes:
  867.     ds.l    1
  868.  
  869. readbytes:
  870.     ds.l    1
  871.  
  872. sourcehandle:
  873.     ds.l    1
  874.  
  875. desthandle:
  876.     ds.l    1
  877.  
  878. outstruct:
  879.     ds.l    1
  880.  
  881. destnamestart:
  882.     ds.l    1
  883.  
  884. destnameend:
  885.     ds.l    1
  886.  
  887. destnamelen:
  888.     ds.l    1
  889.  
  890. sourcenamestart:
  891.     ds.l    1
  892.  
  893. sourcenameend:
  894.     ds.l    1
  895.  
  896. sourcenamelen:
  897.     ds.l    1
  898.  
  899. commandstart:
  900.     ds.l    1
  901.  
  902. commandend:
  903.     ds.l    1
  904.  
  905. commandlen:
  906.     ds.l    1
  907.  
  908. dosbase:
  909.     ds.l    1
  910.  
  911. spacenumber:
  912.     ds.l    1
  913.  
  914. mode:
  915.     ds.b    1
  916.  
  917. sourcename:
  918.     ds.b    256
  919.  
  920. destname:
  921.     ds.b    256
  922.  
  923. sourcebuf:
  924.     ds.b    1024
  925.  
  926. destbuf:
  927.     ds.b    2048
  928.  
  929. spacebuf:
  930.     ds.b    1024
  931.  
  932. numberbuf:
  933.     ds.b    10
  934.  
  935. len_credits    =    text_cursoroff-text_credits
  936.